package com.gong.suanfa;

import com.gong.yuanma.spring.Person;
import com.sun.deploy.security.MozillaJSSDSASignature;
import com.sun.media.sound.RIFFInvalidDataException;
import javafx.beans.binding.When;
import jdk.nashorn.internal.objects.NativeNumber;
import org.slf4j.Logger;
import sun.plugin.WJcovUtil;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.logging.Level;


/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/22 0022 9:37
 */
public class Solution {

    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] ints = {1,2,3,4,5,6,7,8,9,0};

    }

    public int maxSubArray(int[] nums) {
        int dp = nums[0];

        for (int i = 1; i < nums.length; i++) {
            dp = Math.max(dp+nums[i],nums[i]);
        }

        return dp;
    }


}































